PlatformerJumpController = function(gameObject, jumpSpeed) {
    Controller.call(this, gameObject);
    this.jumpSpeed = jumpSpeed;
};

PlatformerJumpController.prototype = Object.create(Controller.prototype);

PlatformerJumpController.prototype.run = function() {
    if (this.onDebug) {
        this.onDebug();
    }

    var go = this.gameObject;
    var jumpSpeed = this.jumpSpeed || go.jumpSpeed || go.speedY;

    if (input.up && go.onGround) {
        go.move(0,-10);
        this.gameObject.vy = -jumpSpeed;
        if (go.facingRight) {
            if (this.gameObject.currAnimationName != "jump_r") {
                this.gameObject.animation.gotoAndPlay("jump_r");
                this.gameObject.currAnimationName = "jump_r";
            }
        } else {
            if (this.gameObject.currAnimationName != "jump_l") {
                this.gameObject.animation.gotoAndPlay("jump_l");
                this.gameObject.currAnimationName = "jump_l";
            }
        }
    }
}; //run
